<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<%@ page import="br.softwaresolutions.virtualstore.cart.ShoppingCart " %>
<!-- INICIO BARRA DE INDICACAO DE PROGRESSAO DE PEDIDO -->

<%
ShoppingCart carrinho = (ShoppingCart) session.getAttribute("carrinho");

String step1Str = "01_carrinho_on_linha_off.gif";
String step2Str = "02_login_off_linha_off.gif";
String step3Str = "03_endereco_off_linha_off.gif";
String step4Str = "04_pagamento_off_linha_off.gif";

if(carrinho != null && carrinho.getItemsCount() > 0){
    int step = carrinho.getNextStep();
    
    
    switch (step){
        case 1:
            step1Str = "01_carrinho_on_linha_off.gif";
            break;
        case 2:
            step2Str = "02_login_on_linha_on.gif";
            break;
        case 3:
            step3Str = "03_endereco_on_linha_on.gif";
            step2Str = "02_login_on_linha_on.gif";
            break;
        case 4:
            step4Str = "04_pagamento_on_linha_off.gif";
            step3Str = "03_endereco_on_linha_on.gif";
            step2Str = "02_login_on_linha_on.gif";
            break;
    }
    /*
    System.out.print("111-"+ step1Str);
    System.out.print("222-"+ step2Str);
    System.out.print("333-"+ step3Str);
    System.out.print("444-"+ step4Str);
*/
}
%>

<table width="100%" border="0" cellspacing="0" cellpadding="0" background="<%=request.getContextPath() %>${initParam['imageDir']}fundo_azul.JPG">
    <tr>
        <td>&nbsp;&nbsp;</td>
    </tr>
    <tr>
        <td>
            <table align="center" border="0" width="95%">
                <tr>
                    <td>
                        <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
                            <tr>
                                <td background="<%=request.getContextPath() %>${initParam['imageDir']}fundo_linha_off.gif" width="30%">
                                    <a href="<%=request.getContextPath() %>/urlmap/carrinho.jsp">
                                        <img src="<%=request.getContextPath() %>${initParam['imageDir']}<%= step1Str%>" alt="" border="0">
                                    </a>
                                </td>
                                <td background="<%=request.getContextPath() %>${initParam['imageDir']}fundo_linha_off.gif" width="30%">
                                    <img src="<%=request.getContextPath() %>${initParam['imageDir']}<%= step2Str%>" alt="" border="0">
                                </td>
                                <td background="<%=request.getContextPath() %>${initParam['imageDir']}fundo_linha_off.gif" width="30%">
                                    <img src="<%=request.getContextPath() %>${initParam['imageDir']}<%= step3Str%>" alt="" border="0">
                                </td>
                                <td align="right" background="<%=request.getContextPath() %>${initParam['imageDir']}fundo_linha_off.gif" width="10%">
                                    <img src="<%=request.getContextPath() %>${initParam['imageDir']}<%= step4Str%>" alt="" border="0">
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>

<!-- FIM BARRA DE PROGRASSAO DE PEDIDO -->
